# -*- coding: utf-8 -*-
"""
Created on Mon Oct 26 09:15:57 2020

@author: xyz

封装nlmixr包的函数

"""

import json
import traceback

import rpy2.robjects as robjects
from rpy2.robjects import globalenv, baseenv

import rpy2.robjects
# from rpy2.robjects.conversion import *
# from rpy2.robjects.environments import *

from rpy2.robjects.packages import *

from rpy2.robjects.robject import *
from rpy2.robjects.vectors import *


base = importr("base")
stats = importr("stats")
nlmixr = importr("nlmixr")
RxODE = importr("RxODE")
MASS = importr("MASS")
data_table = importr("data.table")
ggforce = importr('ggforce')
ggplot2 = importr("ggplot2")
gridExtra = importr("gridExtra")
xpose = importr("xpose")
xpose_nlmixr = importr("xpose.nlmixr")
grDevices = importr("grDevices") # PDF函数的包
graphics = importr("graphics")

#base包
#设置控制台打印行数
base.options(max_print=100000)

#stats包


#nlmixr包
to_fit = robjects.r.nlmixr #nlmixr的封装
tableControl = robjects.r.tableControl

#RxODE包

#MASS包

#data.table包

#ggforce包

#ggplot2
coord_cartesian = ggplot2.coord_cartesian
scale_x_continuous = ggplot2.scale_x_continuous
scale_y_continuous = ggplot2.scale_y_continuous

#gridExtra包
grid_arrange = gridExtra.grid_arrange

#xpose包
dv_vs_pred = xpose.dv_vs_pred
xpose_data_nlmixr = robjects.r.xpose_data_nlmixr
theme_xp_nlmixr = robjects.r.theme_xp_nlmixr

#xpose.nlmixr包

#grDevices包
pdf = grDevices.pdf
dev_off = grDevices.dev_off

#graphics包
plot = graphics.plot






